package com.qf.service;

import com.qf.dao.UserDao;

/**
 * @version 1.0
 * @auther Administrator
 * @date 2023/2/6 15:40
 */
public class UserServiceImpl implements UserService{

    //强耦合
//    private UserDao userDao = new UserDaoImpl();

    //声明  一个接口
    private UserDao userDao;

    //构造器 依赖注入
    /*public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }*/

    //set 方法 依赖注入
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    /**
     * 查询
     */

    public void findUser() {
        System.out.println("我是UserServiceImpl，我要调用下面的");
        userDao.findUser();
    }
}
